package com.binhthuan.catechist.client.data;

import com.binhthuan.catechist.shared.constant.Parameter;
import com.binhthuan.catechist.shared.constant.Service;
import com.smartgwt.client.data.fields.DataSourceFloatField;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;

public class MarkTypeDS extends AbstractDS {

    private static MarkTypeDS instance;

    private MarkTypeDS() {
        super(Service.EXAMINATION_TYPE);

        DataSourceIntegerField id = new DataSourceIntegerField(Parameter.ID);
        id.setPrimaryKey(true);
        id.setHidden(true);

        DataSourceTextField name = new DataSourceTextField(Parameter.NAME);
        DataSourceFloatField factor = new DataSourceFloatField(Parameter.FACTOR);

        setFields(id, name, factor);
    }

    public static MarkTypeDS getInstance() {
        if (instance == null) {
            instance = new MarkTypeDS();
        }
        return instance;
    }
}
